##### Code for calculating effect sizes and confidence intervals for construct validation tasks described in the Method of Study 1 in Salomon and Cimpian, "The Inherence Heuristic as a Source of Essentialist Thought"


##### Read in data

construct=read.table('IH-Ess-Construct-ForCI.csv',sep=',',header=T,na.string=c('-1'))
colnames(construct)
summary(construct)

###### Compute Cohen's d and associated confidence interval for belief prediction task

inherentagree = construct[4]
extrinsicagree = construct[6]

library(effsize)
cohen.d(unlist(inherentagree), unlist(extrinsicagree),pooled=TRUE,paired=TRUE, conf.level=0.95)


###### Compute Cohen's d and associated confidence interval for belief prediction task

inherentdisagree = construct[5]
extrinsicdisagree = construct[7]

library(effsize)
cohen.d(unlist(inherentdisagree), unlist(extrinsicdisagree),pooled=TRUE,paired=TRUE, na.rm=TRUE, conf.level=0.95)


###### Compute Cohen's d and associated confidence interval for belief prediction task

inherent = construct[2]
extrinsic = construct[3]

library(effsize)
cohen.d(unlist(inherent), unlist(extrinsic),pooled=TRUE,paired=TRUE, conf.level=0.95)
